home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / mus / play / MultiPlyr132sr.lha / oktaplay.asm < prev    next >
Assembly Source File  |  1992-09-14  |  20KB  |  684 lines

  1. * MultiPlayer
  2. * Copyright (C) 1992 Bryan Ford
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. *
  18. * I (the author of MultiPlayer) can be contacted on the Internet at
  19. * "bryan.ford@m.cc.utah.edu".  See "Player.doc" for other addresses.
  20. *
  21. * Note:  This playroutine was not originally written by me.  In general
  22. * these playroutines are public domain, so I am bringing the versions
  23. * modified for MultiPlayer under the General Public License.  In the
  24. * few cases of already-copyrighted playroutines, the above copyright
  25. * notice applies only to the parts of the file written by me.
  26. *
  27. * $Id: oktaplay.asm,v 4.1 92/06/21 11:14:42 BAF Exp Locker: BAF $
  28. *
  29.  
  30.         include "player.i"
  31.         include "bry/macros.i"
  32.  
  33.         code    text
  34.  
  35.         xref    modmem,modend,intsongpos,intrepeat,diecorrupt,dmawait,getfreqmodspeed
  36.         xref    okta8start
  37.  
  38.         xdef    oktastart
  39.  
  40. oktastart:
  41.         bsr.b   2$
  42.         lea     rs_channelmodes(pc),a0
  43.         tst.l   (a0)+
  44.         bne     okta8start
  45.         tst.l   (a0)+
  46.         bne     okta8start
  47.  
  48.         plstartret 9$
  49.  
  50. 1$      lea     name(pc),a0
  51.         ml      a0,d0
  52.         rts
  53.  
  54. 2$      movem.l d2-d7/a2-a6,-(sp)
  55.         jsr     rs_init(pc)
  56.         bmi     diecorrupt
  57.         movem.l (sp)+,d2-d7/a2-a6
  58.         rts
  59.  
  60.         cnop    0,4
  61.         dc.l    gmod_Hook+4
  62. 9$      gmodnop
  63.         gmodbra 2$                      ; StartMusic
  64.         gmodnop
  65.         gmodnop
  66.         gmodnop
  67.         gmodnop
  68.         gmodnop
  69.         gmodnop
  70.         gmodbra aud0int
  71.         gmodbra aud1int
  72.         gmodbra aud2int
  73.         gmodbra aud3int
  74.         gmodnop
  75.         gmodnop
  76.         gmodnop
  77.         gmodbra getfreqmodspeed         ; GetFrequency
  78.         gmodbra rs_int                  ; TimerTick
  79.         gmodbra 1$                      ; GetMakerName
  80.         move.l  #GMODHF_REPEAT!GMODHF_SEQUENCE,d0       ; Hook
  81.         rts
  82.  
  83.  
  84. **********************************
  85. * OKTALYZER V1.1 REPLAYER SOURCE *
  86. **********************************
  87.  
  88. ;by A.Sander with Defpac2
  89. ;(C) 1989 VERLAG MAYER
  90. ;- only for 4-Channels
  91.  
  92. * init ********************************
  93.  
  94. p:
  95.  
  96. rs_init         move.l  modmem,a5
  97.                 cmp.l   #'OKTA',(a5)+
  98.                 bne     rs_error2
  99.                 cmp.l   #'SONG',(a5)+
  100.                 bne     rs_error2
  101.                 move.l  a5,a0
  102.                 lea     rs_cmformat(pc),a1
  103.                 bsr     rs_search
  104. *                lea     rs_channelmodes(pc),a0
  105. *                tst.l   (a0)+
  106. *                bne     rs_error2
  107. *                tst.l   (a0)+
  108. *                bne     rs_error2
  109.                 move.l  a5,a0
  110.                 lea     rs_extformat(pc),a1
  111.                 bsr     rs_search
  112.                 move.l  a5,a0
  113.                 bsr     rs_getpatts
  114.                 move.l  a5,a0
  115.                 bsr     rs_getsamples
  116.  
  117.                 clr.w   rs_pointer
  118.                 bsr     rs_gettrkpos
  119.                 sub.l   #16,rs_trkpos
  120.                 subq.w  #1,rs_patty
  121.  
  122.                 move.l  #$40404040,rs_vol
  123.                 clr.w   rs_filter
  124.                 move.w  rs_speed,rs_actspeed
  125.                 clr.w   rs_actcyc
  126.                 move.w  #-1,rs_nextpt
  127.  
  128.                 lea     rs_pbuffs,a0
  129.                 moveq   #15,d0
  130. rs_loop4        clr.l   (a0)+
  131.                 dbf     d0,rs_loop4
  132.                 lea     rs_pattline,a0
  133.                 moveq   #3,d0
  134. rs_loop5        clr.l   (a0)+
  135.                 dbf     d0,rs_loop5
  136.  
  137.                 cq      d0
  138.                 cq      d1
  139.                 mw      rs_len(pc),d1
  140.                 jsr     intsongpos
  141.  
  142.                 moveq   #0,d0
  143.                 rts
  144. rs_error2       moveq   #-1,d0
  145.                 rts
  146.  
  147. * format search ***********************
  148.  
  149. ;a0 fpt
  150. ;a1 format list
  151.  
  152. rs_search       move.l  a0,a2
  153.                 move.l  (a1)+,d0
  154.                 beq.s   rs_ex
  155. rs_loop         cmp.l   modend,a2
  156.                 bhs.s   rs_ex
  157.                 cmp.l   (a2)+,d0
  158.                 bne.s   rs_next
  159.                 move.l  (a1)+,d0
  160.                 cmp.l   (a2)+,d0
  161.                 ble.s   rs_nocorrect
  162.                 move.l  -4(a2),d0
  163. rs_nocorrect    move.l  (a1)+,a3
  164. rs_copy         subq.l  #1,d0
  165.                 bmi.s   rs_search
  166.                 move.b  (a2)+,(a3)+
  167.                 bra.s   rs_copy
  168. rs_next         add.l   (a2)+,a2
  169.                 bra.s   rs_loop
  170. rs_ex           rts
  171.  
  172. * pattern descriptor ******************
  173.  
  174. rs_getpatts     lea     rs_pattpts(pc),a1
  175.                 move.l  #'PBOD',d0
  176. rs_loop2        cmp.l   modend,a0
  177.                 bhs.s   rs_ready
  178.                 movem.l (a0)+,d1-d2
  179.                 cmp.l   d0,d1
  180.                 beq.s   rs_got
  181.                 add.l   d2,a0
  182.                 bra.s   rs_loop2
  183. rs_got          move.l  a0,(a1)+
  184.                 add.l   d2,a0
  185.                 bra.s   rs_loop2
  186. rs_ready        rts
  187.  
  188. * sample descriptor *******************
  189.  
  190. rs_getsamples   lea     rs_samplepts(pc),a1
  191.                 lea     rs_samples(pc),a2
  192.                 move.l  #'SBOD',d0
  193. rs_loop2a       cmp.l   modend,a0
  194.                 bhs.s   rs_sready
  195.                 movem.l (a0)+,d1-d2
  196.                 cmp.l   d0,d1
  197.                 beq.s   rs_gots
  198.                 add.l   d2,a0
  199.                 bra.s   rs_loop2a
  200. rs_gots         tst.l   20(a2)
  201.                 bne.s   rs_setsample
  202.                 lea     32(a2),a2
  203.                 clr.l   (a1)+
  204.                 bra.s   rs_gots
  205. rs_setsample    move.l  a0,(a1)+
  206.                 lea     32(a2),a2
  207.                 add.l   d2,a0
  208.                 bra.s   rs_loop2a
  209. rs_sready       rts
  210.  
  211. * exit ********************************
  212.  
  213. rs_int          movem.l d0-d7/a0-a6,-(sp)
  214.                 bsr.b   rs_rh
  215.                 movem.l (sp)+,d0-d7/a0-a6
  216.                 rts
  217.  
  218. rs_rh           bsr     rs_p4
  219.                 addq.w  #1,rs_actcyc
  220.                 move.w  rs_actspeed,d0
  221.                 cmp.w   rs_actcyc,d0
  222.                 ble.s   rs_addcyc
  223.                 rts
  224.  
  225. rs_addcyc       clr.w   rs_actcyc
  226.                 moveq   #16,d0
  227.                 add.l   d0,rs_trkpos
  228.                 addq.w  #1,rs_patty
  229.                 bsr     rs_getppatt
  230.                 tst.w   rs_nextpt
  231.                 bpl.s   rs_pattend
  232.                 cmp.w   rs_patty,d0
  233.                 bgt.s   rs_nonew
  234. rs_pattend      clr.w   rs_patty
  235.                 tst.w   rs_nextpt
  236.                 bmi     rs_nonextpt
  237.                 move.w  rs_nextpt,rs_pointer
  238.                 bra.s   rs_newpos
  239. rs_nonextpt     addq.w  #1,rs_pointer
  240. rs_newpos       move.w  rs_pointer(pc),d0
  241.                 cmp.w   rs_len(pc),d0
  242.                 bne.s   rs_nonewinit
  243.                 clr.w   rs_pointer
  244.                 move.w  rs_speed(pc),rs_actspeed
  245.                 jsr     intrepeat
  246. rs_nonewinit    mw      rs_pointer(pc),d0
  247.                 mw      rs_len(pc),d1
  248.                 jsr     intsongpos
  249.                 bsr     rs_gettrkpos
  250. rs_nonew        move.l  rs_trkpos(pc),a0
  251.                 lea     rs_pattline(pc),a1
  252.                 move.l  (a0)+,(a1)+
  253.                 move.l  (a0)+,(a1)+
  254.                 move.l  (a0)+,(a1)+
  255.                 move.l  (a0)+,(a1)+
  256.                 move.w  #-1,rs_nextpt
  257.                 rts
  258.  
  259. rs_p4           tst.w   rs_actcyc
  260.                 bne.s   rs_effects
  261.  
  262.                 bsr     rs_set
  263.                 tst.w   d4
  264.                 beq.s   rs_effects
  265.                 bsr     dmawait
  266.                 bsr     rs_setperiods
  267.                 or.w    #$8000,d4
  268.                 move.w  d4,$dff096
  269.                 bsr     dmawait
  270.                 bsr     rs_action
  271.  
  272. rs_effects      bsr     rs_effect
  273.                 lea     rs_vol,a0
  274.                 lea     $dff0a9,a1
  275.                 move.b  (a0)+,(a1)
  276.                 move.b  (a0)+,$10(a1)
  277.                 move.b  (a0)+,$20(a1)
  278.                 move.b  (a0)+,$30(a1)
  279.                 tst.b   rs_filter
  280.                 beq.s   rs_blink
  281.                 bclr    #1,$bfe001
  282.                 rts
  283. rs_blink        bset    #1,$bfe001
  284.                 rts
  285.  
  286. rs_set          lea     rs_samplepts,a0
  287.                 lea     rs_pattline,a2
  288.                 lea     rs_pbuffs,a3
  289.                 lea     $dff0a0,a4
  290.                 lea     rs_periods,a6
  291.  
  292.                 moveq   #0,d4
  293.                 moveq   #1,d5
  294.                 moveq   #3,d7
  295.  
  296. rs_ploop        bsr.s   rs_set4
  297.                 addq.w  #4,a2
  298.                 lea     16(a3),a3
  299.                 lea     $10(a4),a4
  300.                 add.w   d5,d5
  301.                 dbf     d7,rs_ploop
  302.                 rts
  303.  
  304. rs_set4         moveq   #0,d3
  305.                 move.b  (a2),d3
  306.                 beq     rs_noset
  307.                 subq.w  #1,d3
  308.                 moveq   #0,d0
  309.                 move.b  1(a2),d0
  310.                 add.w   d0,d0
  311.                 add.w   d0,d0
  312.                 move.l  0(a0,d0.w),d2
  313.                 beq     rs_noset
  314.                 lsl.w   #3,d0
  315.                 lea     rs_samples,a1
  316.                 add.w   d0,a1
  317.                 tst.w   30(a1)
  318.                 beq     rs_noset
  319.                 move.l  20(a1),d1
  320.                 lsr.l   #1,d1
  321.                 tst.w   d1
  322.                 beq     rs_noset
  323.                 move.w  #124,6(a4)
  324.                 lsl.w   #7,d5
  325.                 move.w  d5,$dff09a
  326.                 lsr.w   #7,d5
  327.                 move.w  d5,$dff096
  328.                 or.w    d5,d4
  329.                 move.l  d2,(a4)
  330.                 move.w  d3,12(a3)
  331.                 add.w   d3,d3
  332.                 move.w  0(a6,d3.w),14(a3)
  333.                 move.l  a0,-(sp)
  334.                 lea     rs_vol,a0
  335.                 moveq   #0,d0
  336.                 move.b  rs_volum1(pc,d7.w),d0
  337.                 move.b  29(a1),0(a0,d0.w)
  338.                 move.l  (sp)+,a0
  339.                 tst.w   26(a1)
  340.                 beq.s   rs_norep
  341.                 tst.w   24(a1)
  342.                 bne.s   rs_realrep
  343.  
  344.                 move.w  26(a1),4(a4)
  345.                 clr.l   (a3)
  346.                 clr.w   4(a3)
  347.                 moveq   #0,d0
  348.                 move.w  26(a1),d0
  349.                 add.l   d0,d0
  350.                 add.l   d0,d2
  351.                 move.l  d2,6(a3)
  352.                 move.l  20(a1),d1
  353.                 sub.l   d0,d1
  354.                 lsr.l   #1,d1
  355.                 move.w  d1,10(a3)
  356.                 rts
  357.  
  358. rs_volum1       dc.b    3,2,1,0
  359.  
  360. rs_realrep      move.w  24(a1),4(a4)
  361.                 moveq   #0,d0
  362.                 move.w  24(a1),d0
  363.                 add.l   d0,d0
  364.                 add.l   d2,d0
  365.                 move.l  d0,(a3)
  366.                 move.w  26(a1),4(a3)
  367.                 moveq   #0,d0
  368.                 move.w  24(a1),d0
  369.                 add.w   26(a1),d0
  370.                 add.l   d0,d0
  371.                 add.l   d0,d2
  372.                 move.l  d2,6(a3)
  373.                 move.l  20(a1),d1
  374.                 sub.l   d0,d1
  375.                 lsr.l   #1,d1
  376.                 move.w  d1,10(a3)
  377.                 rts
  378.  
  379. rs_norep        move.w  d1,4(a4)
  380.                 moveq   #2,d0
  381.                 move.l  d0,(a3)
  382.                 move.w  #1,4(a3)
  383.                 clr.l   6(a3)
  384.                 clr.w   10(a3)
  385. rs_noset        rts
  386.  
  387. rs_setperiods   lea     rs_pbuffs,a3
  388.                 lea     $dff000,a4
  389.                 btst    #0,d4
  390.                 beq.s   rs_notc1
  391.                 move.w  14(a3),$a6(a4)
  392. rs_notc1        btst    #1,d4
  393.                 beq.s   rs_notc2
  394.                 move.w  14+16(a3),$b6(a4)
  395. rs_notc2        btst    #2,d4
  396.                 beq.s   rs_notc3
  397.                 move.w  14+32(a3),$c6(a4)
  398. rs_notc3        btst    #3,d4
  399.                 beq.s   rs_notc4
  400.                 move.w  14+48(a3),$d6(a4)
  401. rs_notc4        rts
  402.  
  403. rs_action       lea     rs_pbuffs,a3
  404.                 lea     $dff0a0,a4
  405.                 moveq   #3,d7
  406. rs_aloop        move.l  (a3),d0
  407.                 beq.s   rs_nopt
  408.                 move.l  d0,(a4)
  409.                 clr.l   (a3)
  410. rs_nopt         move.w  4(a3),d0
  411.                 beq.s   rs_nolen
  412.                 move.w  d0,4(a4)
  413.                 clr.w   4(a3)
  414. rs_nolen        lea     16(a3),a3
  415.                 lea     $10(a4),a4
  416.                 dbf     d7,rs_aloop
  417.                 rts
  418.  
  419. rs_effect       lea     p(pc),a1
  420.                 lea     rs_pattline,a2
  421.                 lea     rs_pbuffs,a3
  422.                 lea     $dff0a0,a4
  423.                 lea     rs_periods,a6
  424.                 moveq   #1,d5
  425.                 moveq   #3,d7
  426. rs_eloop        bsr     rs_doeff
  427.                 addq.w  #4,a2
  428.                 lea     $10(a3),a3
  429.                 lea     $10(a4),a4
  430.                 add.w   d5,d5
  431.                 dbf     d7,rs_eloop
  432.                 rts
  433.  
  434. rs_doeff        moveq   #0,d0
  435.                 move.b  2(a2),d0
  436.                 add.w   d0,d0
  437.                 moveq   #0,d1
  438.                 move.b  3(a2),d1
  439.  
  440.                 move.w  rs_effecttab(pc,d0.w),d0
  441.                 beq.s   rs_noeff
  442.                 bmi.s   rs_1eff
  443.  
  444.                 jsr     0(a1,d0.w)
  445.                 bra.s   rs_noeff
  446.  
  447. rs_1eff         tst.w   rs_actcyc
  448.                 bne.s   rs_noeff
  449.                 neg.w   d0
  450.                 jsr     0(a1,d0.w)
  451. rs_noeff        rts
  452.  
  453. rs_effecttab    dc.w    0,rs_portd-p,rs_portu-p,0,0,0
  454.                 dc.w    0,0,0,0,rs_arp-p,rs_arp2-p
  455.                 dc.w    0,rs_slided-p,0,p-rs_filt,0,p-rs_slideu
  456.                 dc.w    0,0,0,p-rs_slided,0,0
  457.                 dc.w    0,p-rs_posjmp,0,p-rs_release,p-rs_cspeed,0
  458.                 dc.w    rs_slideu-p,rs_volume-p,0,0,0,0
  459.  
  460. rs_portd        sub.w   d1,14(a3)
  461.                 bpl.s   rs_pdok
  462.                 move.w  #113,14(a3)
  463. rs_pdok         move.w  14(a3),6(a4)
  464.                 rts
  465.  
  466. rs_portu        add.w   d1,14(a3)
  467.                 bpl.s   rs_puok
  468.                 move.w  #113,14(a3)
  469. rs_puok         move.w  14(a3),6(a4)
  470.                 rts
  471.  
  472. rs_arp          move.w  12(a3),d2
  473.                 move.w  rs_actcyc,d0
  474.                 move.b  rs_divtab(pc,d0.w),d0
  475.                 bne.s   rs_val1
  476.                 and.w   #$f0,d1         ;runter
  477.                 lsr.w   #4,d1
  478.                 sub.w   d1,d2
  479.                 bra.s   rs_setarp
  480.  
  481. rs_val1         subq.b  #1,d0
  482.                 bne.s   rs_val2
  483.                 move.w  d2,8(a4)
  484.                 bra.s   rs_setarp
  485.  
  486. rs_val2         and.w   #$0f,d1
  487.                 add.w   d1,d2
  488.                 bra.s   rs_setarp
  489.  
  490. rs_divtab       dc.b    0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2
  491.  
  492. rs_arp2         move.w  12(a3),d2
  493.                 move.w  rs_actcyc,d0
  494.                 and.w   #3,d0
  495.                 bne.s   rs_val3
  496.                 bra.s   rs_setarp
  497.  
  498. rs_val3         subq.b  #1,d0
  499.                 bne.s   rs_val4
  500.                 and.w   #$f,d1
  501.                 add.w   d1,d2
  502.                 bra.s   rs_setarp
  503.  
  504. rs_val4         subq.b  #1,d0
  505.                 beq.s   rs_setarp
  506.                 and.w   #$f0,d1
  507.                 lsr.w   #4,d1
  508.                 sub.w   d1,d2
  509.  
  510. rs_setarp       tst.w   d2
  511.                 bpl.s   rs_arpok1
  512.                 moveq   #0,d2
  513. rs_arpok1       cmp.w   #35,d2
  514.                 ble.s   rs_arpok2
  515.                 moveq   #35,d2
  516. rs_arpok2       add.w   d2,d2
  517.                 move.w  0(a6,d2.w),d0
  518.                 move.w  d0,6(a4)
  519.                 move.w  d0,14(a3)
  520.                 rts
  521.  
  522. rs_slided       move.w  12(a3),d2
  523.                 sub.w   d1,d2
  524.                 move.w  d2,12(a3)
  525.                 bra.s   rs_setarp
  526.  
  527. rs_slideu       move.w  12(a3),d2
  528.                 add.w   d1,d2
  529.                 move.w  d2,12(a3)
  530.                 bra.s   rs_setarp
  531.  
  532. rs_cspeed       tst.b   d1
  533.                 beq.s   rs_nochange
  534.                 and.w   #$f,D1
  535.                 move.w  d1,rs_actspeed
  536. rs_nochange     rts
  537.  
  538. rs_filt         tst.b   d1
  539.                 sne     rs_filter
  540.                 rts
  541.  
  542. rs_volume       move.l  a0,-(sp)
  543.                 lea     rs_vol,a0
  544.                 moveq   #0,d0
  545.                 move.b  volum2(pc,d7.w),d0
  546.                 add.w   d0,a0
  547.                 cmp.w   #$40,d1
  548.                 bgt.s   rs_4567
  549.                 move.b  d1,(a0)
  550. rs_vex          move.l  (sp)+,a0
  551.                 rts
  552.  
  553. volum2          dc.b    3,2,1,0
  554.  
  555. rs_4567         sub.b   #$40,d1
  556.                 cmp.b   #$10,d1
  557.                 blt.s   rs_4
  558.                 sub.b   #$10,d1
  559.                 cmp.b   #$10,d1
  560.                 blt.s   rs_5
  561.                 sub.b   #$10,d1
  562.                 cmp.b   #$10,d1
  563.                 blt.s   rs_6
  564.                 sub.b   #$10,d1
  565.                 cmp.b   #$10,d1
  566.                 blt.s   rs_7
  567.                 bra.s   rs_vex
  568.  
  569. rs_6            tst.w   rs_actcyc
  570.                 bne.s   rs_vex
  571.  
  572. rs_4            sub.b   d1,(a0)
  573.                 bpl.s   rs_vex
  574.                 clr.b   (a0)
  575.                 bra.s   rs_vex
  576.  
  577. rs_7            tst.w   rs_actcyc
  578.                 bne.s   rs_vex
  579.  
  580. rs_5            add.b   d1,(a0)
  581.                 cmp.b   #$40,(a0)
  582.                 ble.s   rs_vex
  583.                 move.b  #$40,(a0)
  584.                 bra.s   rs_vex
  585.  
  586. rs_release      tst.l   6(a3)
  587.                 beq.s   rs_rex
  588.                 tst.w   10(a3)
  589.                 beq.s   rs_rex
  590.                 move.w  d5,d0
  591.                 lsl.w   #7,d0
  592.                 move.w  d0,$dff09a
  593.                 move.l  6(a3),(a4)
  594.                 move.w  10(a3),4(a4)
  595.                 clr.l   6(a3)
  596.                 clr.w   10(a3)
  597.                 move.w  d0,$dff09c
  598.                 or.w    #$8000,d0
  599.                 move.w  d0,$dff09a
  600. rs_rex          rts
  601.  
  602. rs_posjmp       move.w  d1,d0
  603.                 and.w   #$f,d0
  604.                 lsr.w   #4,d1
  605.                 mulu    #10,d1
  606.                 add.w   d1,d0
  607.                 cmp.w   rs_len,d0
  608.                 bge.s   rs_nojmp
  609.                 move.w  d0,rs_nextpt
  610.                 jsr     intrepeat
  611. rs_nojmp        rts
  612.  
  613. aud0int         clr.l   $a0(a0)
  614.                 move.w  #1,$a4(a0)
  615.                 move.w  #$80,$9a(a0)
  616.                 rts
  617.  
  618. aud1int         clr.l   $b0(a0)
  619.                 move.w  #1,$b4(a0)
  620.                 move.w  #$100,$9a(a0)
  621.                 rts
  622.  
  623. aud2int         clr.l   $c0(a0)
  624.                 move.w  #1,$c4(a0)
  625.                 move.w  #$200,$9a(a0)
  626.                 rts
  627.  
  628. aud3int         clr.l   $d0(a0)
  629.                 move.w  #1,$d4(a0)
  630.                 move.w  #$400,$9a(a0)
  631.                 rts
  632.  
  633. rs_gettrkpos    lea     rs_patterns,a0
  634.                 add.w   rs_pointer,a0
  635.                 moveq   #0,d0
  636.                 move.b  (a0),d0
  637.                 bsr.s   rs_getpattern
  638.                 move.l  a0,rs_trkpos
  639.                 clr.w   rs_patty
  640.                 rts
  641.  
  642. rs_getppatt     lea     rs_patterns,a0
  643.                 add.w   rs_pointer,a0
  644.                 moveq   #0,d0
  645.                 move.b  (a0),d0
  646. rs_getpattern   lea     rs_pattpts,a0
  647.                 add.w   d0,d0
  648.                 add.w   d0,d0
  649.                 move.l  0(a0,d0.w),a0
  650.                 move.w  (a0)+,d0
  651.                 rts
  652.  
  653. rs_cmformat     dc.l    'CMOD',8,rs_channelmodes
  654. rs_extformat    dc.l    'SAMP',36*32,rs_samples
  655.                 dc.l    'SPEE',2,rs_speed
  656.                 dc.l    'PLEN',2,rs_len
  657.                 dc.l    'PATT',128,rs_patterns,0
  658. rs_channelmodes ds.w    4
  659. rs_samples      ds.b    36*32
  660. rs_speed        dc.w    6
  661. rs_len          dc.w    1
  662. rs_patterns     ds.b    128
  663. rs_pattpts      ds.l    64
  664. rs_samplepts    ds.l    36
  665. rs_patty        ds.w    1
  666. rs_trkpos       ds.l    1
  667. rs_pbuffs       ds.l    16
  668. rs_pattline     ds.l    4
  669. rs_actspeed     ds.w    1
  670. rs_actcyc       ds.w    1
  671. rs_nextpt       ds.w    1
  672. rs_pointer      ds.w    1
  673. rs_vol          ds.l    1
  674. rs_filter       ds.w    1
  675. rs_oldaud       ds.l    1
  676. rs_periods      dc.w    $358,$328,$2FA,$2D0,$2A6,$280,$25C,$23A,$21A
  677.                 dc.w    $1FC,$1E0,$1C5,$1AC,$194,$17D,$168,$153,$140
  678.                 dc.w    $12E,$11D,$10D,$FE,$F0,$E2,$D6,$CA,$BE
  679.                 dc.w    $B4,$AA,$A0,$97,$8F,$87,$7F,$78,$71
  680.  
  681. name    dc.b    "Oktalyzer (4 channel)",0
  682.  
  683.         end
  684.